//
//  KKListViewManager.h
//  KKListViewDemo
//
//  Created by liaozhenming on 16/11/4.
//  Copyright © 2016年 liaozhenming. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

typedef void(^KKListViewSectionHeaderEventHandle)(void);
typedef void(^KKListViewSectionFooterEventHandle)(void);

//  section组
@interface KKListViewSectionItem : NSObject

@property (nonatomic, strong) NSString *kk_key;

//  section头部
@property (nonatomic, assign) CGSize sectionHeaderSize;
@property (nonatomic, strong) NSString *sectionHeaderTitle;
@property (nonatomic, strong) NSString *sectionHeaderClassName;
@property (nonatomic, strong) KKListViewSectionHeaderEventHandle headerEventHandle;
@property (nonatomic, strong) id sectionHeaderData;

//  section底部
@property (nonatomic, assign) CGSize sectionFooterSize;
@property (nonatomic, strong) NSString *sectionFooterTitle;
@property (nonatomic, strong) NSString *sectionFooterClassName;
@property (nonatomic, strong) KKListViewSectionFooterEventHandle footerEventHandle;
@property (nonatomic, strong) id sectionFooterData;

@property (nonatomic, strong) NSArray *kk_cellItems;    /**<cell组*/
@property (nonatomic, assign) UIEdgeInsets sectionInsets;


+ (instancetype)kk_sectionItemWithKey:(NSString*)key cellItems:(NSArray*)cellItems;
- (instancetype)initWithKey:(NSString*)key cellItems:(NSArray*)cellItems;

@end

#pragma mark - KKListViewCellItem methods
typedef void(^KKListViewCellSelectedEventHandle)(void);
typedef void(^KKListViewCellClickEventHandle)(NSInteger eventType);

//  cell对象
@interface KKListViewCellItem : NSObject

@property (nonatomic, strong) NSString *kk_key;                 /**<关键字*/
@property (nonatomic, assign) CGFloat kk_rowHeight;             /**<行高*/
@property (nonatomic, assign) CGSize kk_cellSize;               /**<cell的大小*/
@property (nonatomic, strong) NSString *kk_cellClassName;       /**<cell类名*/
@property (nonatomic, strong) id cellData;                      /**<cell内容*/

@property (nonatomic, strong) KKListViewCellSelectedEventHandle selectedEventHandle;
@property (nonatomic, strong) KKListViewCellClickEventHandle clickdEventHandle;


+ (instancetype)kk_cellItemWithKey:(NSString*)key rowHeight:(CGFloat)rowHeight cellClassName:(NSString*)cellClassName;
- (instancetype)initWithKey:(NSString*)key rowHeight:(CGFloat)rowHeight cellClassName:(NSString*)cellClassName;

+ (instancetype)kk_cellItemWithKey:(NSString*)key cellSize:(CGSize)cellSize cellClassName:(NSString*)cellClassName;
- (instancetype)initWithKey:(NSString *)key cellSize:(CGSize)cellSize cellClassName:(NSString *)cellClassName;

@end





